// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_pr.p_c;

import android.content.*;
import android.database.Cursor;
import android.text.TextUtils;
import com.nnee.p_pr.p_atom.cls_u;
import com.nnee.p_pr.p_prov.z;
import java.util.ArrayList;
import java.util.List;

public class cls_m
{

    public m()
    {
    }

    public static List a(Context context, String s, List list)
    {
        ArrayList arraylist;
        if(list == null || list.size() == 0 || TextUtils.isEmpty(s) || context == null)
        {
            arraylist = new ArrayList();
        } else
        {
            StringBuilder stringbuilder = new StringBuilder();
            stringbuilder.append("account").append(" = '").append(s).append("' and ").append("uid").append(" in (");
            int i = 0;
            while(i < list.size()) 
            {
                stringbuilder.append('\'').append(((u)list.get(i)).V()).append('\'');
                if(i != -1 + list.size())
                    stringbuilder.append(',');
                else
                    stringbuilder.append(')');
                i++;
            }
            ArrayList arraylist1 = new ArrayList();
            try
            {
                ContentResolver contentresolver = context.getContentResolver();
                android.net.Uri uri = z.g;
                String as[] = new String[1];
                as[0] = "uid";
                Cursor cursor = contentresolver.query(uri, as, stringbuilder.toString(), null, null);
                if(cursor != null && cursor.moveToFirst())
                    do
                        arraylist1.add(cursor.getString(0));
                    while(cursor.moveToNext());
                if(cursor != null)
                    cursor.close();
            }
            catch(Exception exception)
            {
                exception.printStackTrace();
            }
            arraylist = arraylist1;
        }
        return arraylist;
    }

    protected static boolean a(Context context, String s, String s1)
    {
        if(!TextUtils.isEmpty(s) && !TextUtils.isEmpty(s1) && context != null) goto _L2; else goto _L1
_L1:
        boolean flag = false;
_L4:
        return flag;
_L2:
        String s2 = (new StringBuilder()).append("account = '").append(s).append("' and ").append("uid").append(" = '").append(s1).append("' and ").append("status").append(" = 1").toString();
        try
        {
            Cursor cursor = context.getContentResolver().query(z.g, a, s2, null, null);
            if(cursor != null)
            {
                flag = cursor.moveToFirst();
                cursor.close();
                continue; /* Loop/switch isn't completed */
            }
        }
        catch(Exception exception) { }
        flag = false;
        if(true) goto _L4; else goto _L3
_L3:
    }

    public static boolean b(Context context, String s, String s1)
    {
        boolean flag = true;
        if(!TextUtils.isEmpty(s) && !TextUtils.isEmpty(s1) && context != null) goto _L2; else goto _L1
_L1:
        flag = false;
_L4:
        return flag;
_L2:
        android.net.Uri uri;
        ContentValues contentvalues = new ContentValues();
        contentvalues.put("account", s);
        contentvalues.put("uid", s1);
        contentvalues.put("status", Integer.valueOf(flag));
        contentvalues.put("timestamp", Long.valueOf(System.currentTimeMillis()));
        uri = context.getContentResolver().insert(z.g, contentvalues);
        if(uri == null)
            break MISSING_BLOCK_LABEL_108;
        long l = ContentUris.parseId(uri);
        if(l >= 0L)
            continue; /* Loop/switch isn't completed */
        flag = false;
        continue; /* Loop/switch isn't completed */
        Exception exception;
        exception;
        exception.printStackTrace();
        flag = false;
        if(true) goto _L4; else goto _L3
_L3:
    }

    static String a[];
    public static final int b = 0;
    public static final int c = 1;
    public static final int d = 2;
    public static final int e = 3;
    public static final int f = 4;
    public static final int g = 5;

    static 
    {
        String as[] = new String[6];
        as[0] = "_id";
        as[1] = "account";
        as[2] = "uid";
        as[3] = "status";
        as[4] = "timestamp";
        as[5] = "other";
        a = as;
    }
}
